API Reference > PrizmDoc Server RESTful API > HTML5 Viewing |
HTML5 viewing information.
This API requests or reads the information about a particular document page. The return information is a JSON string. The form has a query parameter, DocumentID, which can have for its value an un-encoded "u" prefix followed by the viewing session ID or a base 64 encoded viewing session ID prefixed with "e". The {PageNumber} parameter always begins with zero (0) for the first page within a document.
Http Method
GET
Resource URL
/PCCIS/V1/Page/q/{pageNumber}/Attributes?DocumentID=[e,u]{ViewingSessionId}& ContentType=[png, svg, svga, svgb]
Parameters
PageNumber |
The page number of the document being requested. The first page within a document is always 0. |
DocumentID |
The Viewing Session ID. |
ContentType |
(Optional). The intended content of the page image. |
Request Body
Empty.
Response Body
If successful, this method returns an object with the following properties:
Property Name |
Value |
Description |
version |
String |
The version of the Viewing Client to consume this request. |
contentType |
String |
The type of content that is available for this document. |
imageBitDepth |
Integer |
The bit depth of the viewable content. |
imageHeight |
Integer |
The height of the viewable content. |
imageWidth | Integer | The width of the viewable content. |
imageXResolution |
Integer |
The X resolution of the viewable content. |
imageYResolution |
Integer |
The Y resolution of the viewable content. |
Example |
Copy Code
|
---|---|
GET http://localhost:18681/PCCIS/V1/Page/q/0/Attributes?DocumentID=eOQA...
|
Example Response |
Copy Code
|
---|---|
{"version":"7.1","contentType":"jpeg,png,svg","imageBitDepth":16, "imageHeight":990,"imageWidth":765,"imageXResolution":0,"imageYResolution":0} |
This RESTful API returns a full page image. The Scale and ContentType query parameters affect the image with respect to the parameters intent. The ContentType parameter may have the following parameter value for now: JPEG, PNG, SVG, SVGA, or SVGB. If SVG, SVGA, or SVGB is chosen, the scale values are ignored as a SVG (vectored) stream is returned for which this parameter has no practical meaning. The scale query parameter with a value 1.0 gives a non-resized image. Less than 1.0 values shrink the image and larger than 1.0 values increase the image size.
SVGA is standard SVG content with additional optimizations to reduce the payload size. SVGA is not compatible with the Internet Explorer 10 browser, in which case SVG should be used instead. |
SVGB is standard SVG content additionally optimized by replacing SVG curves representing font letters with Unicode font to reduce payload size. Note: "svgb" provides better optimization and visually more consistent results. SVGB is not compatible with the Internet Explorer 9 & 10 browser, desktop Safari 9.x or Chrome on Windows in which case SVG, or SVGA for IE 9, should be used instead. |
The API will now interpret an optional request header:
Accept-Encoding: gzip[,deflate,sdch]
The API will look for the value 'gzip' to mean that the Viewing Client is able to handle Gzipped SVG/SVGA/SVGB content. Based on this header value, the API will compress the response SVG/SVGA/SVGB content using the Gzip format. It will add the following header in the response:
Content-Encoding: gzip
Uncompressed data lengths less than 500 bytes will not be compressed. |
Most modern browsers can handle Gzipped content. If you would like to see reduction in the network bandwidth usage for the SVG/SVGA/SVGB content in the response, then make sure that your webtier/proxy does not strip these headers.
Raster Images (content types : png,jpg) will not be Gzip compressed. |
Http Method
GET
Resource URL
/PCCIS/V1/Page/q/{PageNumber}?DocumentID=[e,u]{ViewingSessionId}&Scale={Scale}&ContentType=[jpeg, png, svg, svga, svgb]
Parameters
PageNumber |
The page number of the document being requested. The first page within a document is always 0. |
DocumentID |
The Viewing Session ID. |
Scale |
The intended scale value of the page image. This is ignored for SVG streams. |
ContentType |
The intended content type of the page image. |
Request Header
(optional)
Accept-Encoding: gzip[,deflate,sdch]
Request Body
Empty.
Response Header
Content-Encoding: gzip
Note: This header will exist only if the request contained the optional header, Accept-Encoding: gzip.
Response Body
If successful, this method returns either the requested page content or, if the requested svg content type cannot be provided, an object is returned containing an errorCode with the value SvgNotAvailable and the pageAttributes for png content type. This is provided as an optimization to fallback to png when svg is not available.
Example |
Copy Code
|
---|---|
GET http://localhost:18681/PCCIS/V1/Page/q/0?DocumentID=eOQA5... &Scale=1&ContentType=svg
|
Example Response |
Copy Code
|
---|---|
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns=http://www.w3.org/2000/svg xmlns:cc="http://creativecommons.org/ns#" ...</svg> |
This request returns a tile of the requested document page. The tile is formed from the pixel coordinate specified by the x and y parameters and the width and height parameters. This tile is resized as determined by the scale factor. The contentTypeshould only be PNG for tiles as JPEG can cause artifact issues in alignment. Requesting SVG content will cause an error response as this content type is vector data and does need to be tiles like raster images. The scale query parameter with a value 1.0 gives a non-resized image. Less than 1.0 values shrink the tile and larger than 1.0 values increase the tile size.
Http Method
GET
Resource URL
/Page/q/{pageNumber}/Tile/{x}/{y}/{width}/{height}?DocumentID=[e,u]{ViewingSessionId}&Scale={Scale Value}&ContentType=png
Parameters
PageNumber |
The page number of the document being requested. The first page within a document is always 0. |
DocumentID |
The Viewing Session ID. |
Scale |
The intended scale value of the page image. This is ignored for SVG streams. |
ContentType |
The intended content type of the page image. |
x |
The x coordinate of the requested tile relative to the original image. |
y |
The y coordinate of the requested tile relative to the original image. |
width |
The width of the requested tile. |
height |
The height of the requested tile. |
Request Body
Empty.
Response Body
If successful, this method provides the requested page tile content.
Example |
Copy Code
|
---|---|
GET http://localhost:18681/PCCIS/V1/Page/q/0/ Tile/0/0/1275/1024?DocumentID=eOAA5... &Scale=1&Quality=100&ContentType=png
|
Example Response |
Copy Code
|
---|---|
Empty |
This request returns a thumbnail of the requested document page. The thumbnail size is constrained within the width and height pixel parameters and the aspect ratio of the image is maintained. The contentType can only be PNG or JPEG.
Http Method
GET
Resource URL
/Page/q/{pageNumber}/{width}x{height}?DocumentID=[e,u]{ViewingSessionId}&ContentType=[jpeg, png]
Parameters
PageNumber |
The page number of the document being requested. The first page within a document is always 0. |
DocumentID |
The Viewing Session ID. |
ContentType |
The intended content type of the thumbnail page image. |
width |
The maximum width of the requested thumbnail. |
height |
The maximum height of the height of the requested thumbnail. |
Request Body
Empty.
Response Body
If successful, this method provides the requested page thumbnail content.
Example |
Copy Code
|
---|---|
GET http://localhost:18681/PCCIS/V1/Page/q/0/ 200x300?DocumentID=eOAA5... &ContentType=png
|
Example Response |
Copy Code
|
---|---|
Empty |
This request returns a JSON string giving the page count of the document requested and the confidence value. Because page rendering may be different than what a file format may indicate for number of pages, there is a need for a confidence value indicating how confident the page count acquired will be prior to having all the pages generated. The DesiredPageCountConfidence parameter indicates what the minimum level required to be returned thus implying how long the request may take to return a precise value. The DesiredPageCountConfidence is segmented in this release where 50 percent or below may get an estimate page count value and above 50 percent will try to get a more accurate count. If apageCountConfidence value of less than 100 percent is returned, it means that the request is still being worked on and to try again if an accurate count is still desired.
Http Method
GET
Resource URL
Parameters
DocumentID |
The Viewing Session ID. |
DesiredPageCountConfidence |
The intended percentage of confidence to use in determining the page count. |
Request Body
Empty.
Response Body
If successful, this method returns an object with the following properties:
Property Name |
Value |
Description |
pageCount |
Integer |
The determined number of pages in the document. |
pageCountConfidence |
Integer |
If value is less than 100 it means that the page count is still being determined, and to try again if a more accurate count is needed. |
Example |
Copy Code
|
---|---|
GET http://localhost:18681/PCCIS/V1/ Document/q/Attributes?DocumentID=eOQA5... &DesiredPageCountConfidence=50
|
Example Response |
Copy Code
|
---|---|
{"pageCount":3,"pageCountConfidence":100} |
This request returns a JSON string containing the text extracted from the given document. The {PageNumberBegin} denotes the first page and {PageNumberEnd} denotes the last page to be included for text extraction. Additionally, information on hyperlinks will be returned if any is available. The lowest value for {PageNumberBegin} parameter is zero (0) – that indicates the first page within the document.
The API will now interpret an optional request header:
Accept-Encoding: gzip[,deflate,sdch]
The API will look for the value 'gzip' to mean that the Viewing Client is able to handle Gzipped extracted text content. Based on this header information, the API will compress the extracted text data content using Gzip format. It will add the following header in the response:
Content-Encoding: gzip
Uncompressed data lengths less than 500 bytes will not be compressed. |
Most modern browsers can handle Gzipped content. If you would like to see reduction in the network bandwidth usage for the extracted text content in the response, then make sure that your webtier/proxy does not strip these headers.
Http Method
GET
Resource URL
/PCCIS/V1/ Document/q/0-2/Text?DocumentID=eMAA2...
Parameters
DocumentID |
The Viewing Session ID. |
PageNumberBegin |
The page to begin extracting text from. |
PageNumberEnd |
The page to end extracting text from. |
Request Header
(optional)
Accept-Encoding: gzip[,deflate,sdch]
Request Body
Empty.
Response Header
Content-Encoding: gzip
Note: This header will exist only if the request header contained the optional header, Accept-Encoding: gzip.
Response Body
If successful, this method returns an object with the following properties:
Property Name |
Value |
Description |
pages |
List |
A list of Nested Objects describing the extracted text for each of the pages in range. |
pages.number |
Integer |
Denotes the number the current page to which the extracted text belongs. |
pages.text |
String |
Extracted text of the current page. |
pages.markup | List | A list of nested objects describing the hyperlinks if there are any. |
pages.markup.changeType | String | The changeType will always be "Add". |
pages.markup.markType | String | The markType will always be "DocumentHyperlink". |
pages.markup.properties | Object | Object containing properties of the hyperlink. |
pages.markup.properties.href | String | A value that indicates the destination of the Hyperlink. |
pages.markup.properties.rectangle | Object | These values will be defined in points (1/72 inch). |
pages.markup.properties.rectangle.x | Integer | The x location of the hyperlink markup to be applied. |
pages.markup.properties.rectangle.y | Integer | The y location of the hyperlink markup to be applied. |
pages.markup.properties.rectangle.width | Integer | The width of the hyperlink markup to be applied. |
pages.markup.properties.rectangle.height | Integer | The height of the hyperlink markup to be applied. |
pages.markup.properties.borderHorizontalRadius | Integer | The horizontal radius of the border of the markup to be applied. |
pages.markup.properties.borderVerticalRadius | Integer | The vertical radius of the border of the markup to be applied. |
pages.markup.properties.borderThickness | Integer | The width of the border of the markup to be applied. |
Example |
Copy Code
|
---|---|
GET http://localhost:18681/PCCIS/V1/Document/q/0-2/Text?DocumentID=eMAA2...
|
Example Response - With Hyperlink Data |
Copy Code
|
---|---|
"pages":[{"number" : 0, "text":"Congratulations You have successfully installed Prizm Content Connect www.accusoft.com Page 1 of Document", "width":612, "height":792, "rectangles":[[97.8, 66.47, 43.32, 74.49], ..., [416.77, 520.44, 6.5, 32.28]], "markup":[{"changeType":"Add", "markType":"DocumentHyperlink", "properties":{"href":"http:www.accusoft.com", "rectangle": {"x":228.1, "y":329.0, "width":155.9, "height":23.0} , "borderHorizontalRadius":0.0, "borderVerticalRadius":0.0, "borderThickness":0.0}}]}]} |
Example Response - Without Hyperlink Data |
Copy Code
|
---|---|
{"pages":[{"number":0,"text":"Congratulations You have successfully installed Prizm Content Connect www accusoft com Page 1 of Document"}, {"number":1, "text":"Page 2 of Document"}, {"number":2,"text":"Page 3 of Document"}]} |